import pilotLampComp from './pilotLamp.vue'
import pilotLampDetail from './pilotLampDetail.vue'
import Vue from "vue";

var pilotLamp = {    
    type:'pilotLamp',//item类型
    checked:false,
    icon:'el-icon-sunset',//item图标
    txt:'指示灯', //item名称,
    methods:{
        install:function(item,page,event){//加载控件,固定命名Install            
            item=Object.assign({
                    type:'pilotLamp',
                    width:40,
                    height:40,
                    state:0,
                    stateIcon:['/static/poilotLamp/state_0.svg','/static/poilotLamp/state_1.svg'],
                    dataCell:null
                }, item);
            return item;
        },
        render:function(refs,item){  //加载控件,固定命名render`  
            //console.log('refs',refs)          
            var comp=Vue.extend(pilotLampComp);
            var instance=new comp({
                propsData:{
                    attr:item
                }
            });
            instance.$mount();
            //console.log('pilotLampRender to refs',refs,instance);
            refs.appendChild(instance.$el);
        },
        detailRender:function(refs,item){//加载详细信息控件,固定命名detailRender`  
            //console.log('refs',refs)     
            var comp=Vue.extend(pilotLampDetail);
            var instance=new comp({
                propsData:{
                    attr:item
                }
            });
            instance.$mount();
            //console.log('pilotLampRenderDetial to refs',refs,instance);
            refs.appendChild(instance.$el);
        }
    }
}

export default pilotLamp;